<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/taglib.jsp" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>修改用户信息</title>
		<%@ include file="/WEB-INF/layouts/edit-header.jsp" %>

		<style type="text/css">
			.detail-label {font-weight: normal;}
		</style>

	</head>
	<body>

		<div class="create-page tpanel">
			<div class="panel-content">
				<div class="container-fluid">
			
					<form id="createForm" class="form-horizontal">
						<input type="hidden" name="id" value="${entity.id}" />

						<div class="form-group form-group-first">
							<label for="realName" class="col-sm-2 control-label">用户名</label>
							<div class="col-sm-8">
								<label class="control-label detail-label">${entity.username}</label>
							</div>
						</div>
					  	<div class="form-group">
							<label for="realName" class="col-sm-2 control-label">姓名</label>
							<div class="col-sm-8">
					  			<input id="realName" name="realName" class="form-control"
										  type="text" minlength="1" maxlength="15" value="${entity.realName}" />
							</div>
					  	</div>
						<div class="form-group">
							<label for="gender" class="col-sm-2 control-label">性别</label>
							<div class="col-sm-8">
								<select name="gender" id="gender" class="form-control">
									<option value="Unknown">未知</option>
									<option value="Male">男</option>
									<option value="Female">女</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="tel" class="col-sm-2 control-label">手机</label>
							<div class="col-sm-8">
					  			<input id="tel" name="tel" class="form-control" isPhone="true"
										  type="text" maxlength="20" value="${entity.tel}" />
							</div>
						</div>
						<div class="form-group">
							<label for="email" class="col-sm-2 control-label">邮箱</label>
							<div class="col-sm-8">
					  			<input id="email" name="email" class="form-control" email="true"
										  type="text" maxlength="30" value="${entity.email}" />
							</div>
						</div>
					  	<div class="form-group">
							<div class="col-sm-12" style="text-align: center;">
								<a class="btn btn-default" href="javascript:window.history.back();">返回</a>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type="submit" class="btn btn-primary" value="保存" />
							</div>
					  	</div>
					  	
					</form>
				
				</div>
			</div>
		</div>
		<script type="text/javascript">
            changeTitle('修改用户信息');

			$(function() {
			    $('#gender').val('${entity.gender}');
                initForm('#createForm','${ctx}/admin/app-user/update',function(r) {
                    var resp = $.parseJSON(r);
                    if(resp.code == 'OK') {
                        window.location.href = '${ctx}/admin/app-user/detail?id=${entity.id}';
                        topLayer.msg('保存成功', {icon: 1});
                    }else {
                        topLayer.msg(resp.message, {icon: 2});
                    }
                });
			});
		</script>
	</body>
</html>
